package com.mkh.st.common.core.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum DocTypeEnum {
	/**
	 * 单据数据权限维度
	 */
	SUPPLIER_RECONCILIATION("SUPPLIER_RECONCILIATION", "供应商对账","1,3"),
	INITIATIVE_STOCK_UP("INITIATIVE_STOCK_UP", "采购主动备货","1,2,3,4,5,7"),
	PURCHASE_RETURN("PURCHASE_RETURN", "采购退货","1,2,3,4,5,7"),
	PURCHASE_ORDER("PURCHASE_ORDER", "采购单","1,2,3,4,5,7"),
	CUSTOMER_PRODUCT_ALIAS("CUSTOMER_PRODUCT_ALIAS", "客户商品别名","7"),
	ROLE_MANAGE("ROLE_MANAGE", "角色管理","1"),
	ORDER_LIST("ORDER_LIST", "订单列表","1,2,6"),
	FIELD_PURCHASE_ORDER("FIELD_PURCHASE_ORDER", "现场采购单","1,2,6"),
	RECEIPT("RECEIPT", "收货单","1,2,6"),
	REFUNDS("REFUNDS", "退货退款","1,2,6"),
	CUSTOMER_MANAGE("CUSTOMER_MANAGE", "客户管理","2"),
	COST_BILL("COST_BILL", "费用单","1,3"),
	SENDERS_LIST("SENDERS_LIST", "补差单","1,6"),
	PURCHASE_INVOICE("PURCHASE_INVOICE", "采购发票登记","1,3"),
	ADVANCE_PAYMENT("ADVANCE_PAYMENT", "预付款","1,3"),
	PAYMENT_REGISTRATION("PAYMENT_REGISTRATION", "付款登记","1,3"),
	CUSTOMER_RECONCILIATION("CUSTOMER_RECONCILIATION", "客户对账","1,6"),
	ADVANCES_RECEIVED("ADVANCES_RECEIVED", "预收款","1,6"),
	SALES_MAKE_INVOICE("SALES_MAKE_INVOICE", "销售开票","1,6"),
	SALES_PAYMENT("SALES_PAYMENT", "销售付款","1,6"),
	BUSINESS_SITE_MANAGE("BUSINESS_SITE_MANAGE", "业务站点维护","1"),
	ACCOUNT_SETTINGS("ACCOUNT_SETTINGS", "账号设置","4"),
	COMPANY_MANAGE("COMPANY_MANAGE", "公司信息维护","1");

	private String code;
	/**
	 * 描述
	 */
	private String description;
	/**
	 * 权限维度id
	 */
	private String scopeIds;

	public static DocTypeEnum get(String code){
		if (Objects.isNull(code)) {
			return null;
		}
		for (DocTypeEnum docTypeEnum : DocTypeEnum.values()){
			if (code.equals(docTypeEnum.code))  return docTypeEnum;
		}
		return null;
	}
}
